#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.oauth.facade.impl;

import ${package}.oauth.facade.AuthorizeConfigProvider;
import org.springframework.core.annotation.Order;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
import org.springframework.stereotype.Component;

/**
 * Description:
 *  在security上配置自定义的拦截
 *
 * @author wupanhua
 * @date 2019-09-02 09:50
 *
 * <pre>
 *              ${copyright}
 *      Copyright (c) 2019. All Rights Reserved.
 * </pre>
 */
@Component
@Order(Integer.MAX_VALUE)
public class UrlPermissionProviderImpl implements AuthorizeConfigProvider {

    /**
     * Description:
     * <配置自定义拦截器>
     * @author wupanhua
     * @date 09:51 2019-09-02
     * @param config security配置链接
     * @return void
     */
    @Override
    public void config(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry config) {
        config.anyRequest().access("@ykUrlPermission.hasUrlPermission(request, authentication)");
    }
}
